package com.qnvip.controller;

import com.qnvip.domain.Product;
import com.qnvip.service.ProductService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Description:
 * @Author: Hank
 * @Date: 2025/3/20 11:35
 */
@RestController
@RequestMapping("/product")
@RequiredArgsConstructor
public class ProductController {
    @Autowired
    private ProductService productService;


//@GetMapping  代码应该有问题
//    public ProductVO page(){
//        Page<Product> page = new Page<>(1, 10);
//        IPage ipage = productService.getBaseMapper().selectPage(page, null);
//        return (ProductVO) ipage;
//    }

    
    @RequestMapping
    public List<Product> selectList() {//为啥我新建的能测试,这个不能测试
        return productService.selectList();
    }
//    @PostMapping      不知道为啥测试有问题
//    public void saveProduct(@RequestBody ProductDTO productDTO){
//        Product product = BeanUtil.copyProperties(productDTO, Product.class);
//        productService.save(product);
//
//    }
//    @DeleteMapping("/{id}")
//    public void removeProduct(@PathVariable("id") Integer id){
//
//        productService.removeById(id);
//    }
//


}
